import './../../static/css/auditList/auditXq.css'
import { Upload, message } from 'antd';
import type { RcFile, UploadFile, UploadProps } from 'antd/es/upload/interface';
import React, { useState } from 'react';
import { useLocation } from "react-router-dom"
const Auditxiang: React.FC = () => {
  const getBase64 = (img: RcFile, callback: (url: string) => void) => {
    const reader = new FileReader();
    reader.addEventListener('load', () => callback(reader.result as string));
    reader.readAsDataURL(img);
  };
  const beforeUpload = (file: RcFile) => {
    const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
    if (!isJpgOrPng) {
      message.error('You can only upload JPG/PNG file!');
    }
    const isLt2M = file.size / 1024 / 1024 < 2;
    if (!isLt2M) {
      message.error('Image must smaller than 2MB!');
    }
    return isJpgOrPng && isLt2M;
  };

  const { state }: any = useLocation()
  // console.log(state);
  const { info } = state
  console.log(info);

  return (
    <div className='box'>
      <div className='leftbox'>
        <div className='left_box'>
          <div className='style'>审核人: <span className='span'>{info.userid}</span> </div>
          <div className='style'>审核状态: <span className='span1'>{info.status === 3 ? '终审通过' : '审核未通过'}</span> </div>
          <div className='style'>审核时间: <span className='span'>{info.addtime}</span> </div>
          <div className='style'>来访人: <span className='span'>{info.v_id}</span> </div>
          <div className='style'>来访电话: <span className='span'>{info.mobile}</span> </div>
          <div className='style'>来访人身份证: <span className='span'>{info.card}</span> </div>
          <div className='style'>进校人名称: <span className='span'>{info.visitor}</span> </div>
          <div className='style'>来访车牌号: <span className='span'>{info.carnumber}</span> </div>
          <div className='style'>进校时间: <span className='span'>2022-05-29 12:00:00</span> </div>
          <div className='style'>离校时间: <span className='span'>2022-05-29 18:00:00</span> </div>
        </div>
        <div className='right-box'>
        </div>
      </div>

    </div>
  )
}
export default Auditxiang